package main.com.hushengjin.singleton;

/**
 * 懒汉式，线程安全，效率低，加锁
 */
public class LazySafeSingleton {
    private static LazySafeSingleton instance;
    private LazySafeSingleton() {}
    public synchronized static LazySafeSingleton getInstance() {
        if (instance == null) return new LazySafeSingleton();
        return instance;
    }
}
